import {
  ApplyTypeEnum,
  AuditStatusEnum,
  IsApplyEnum,
  IsFinishEnum,
  PaymentStatusEnum,
  PayAuditStatusEnum,
  MemberOrderType,
} from '@/enums/membershipEnum';
import type { FormGroupMapItem, FormItemVoMapItem } from './formCompTypes';

export interface ApplyTemplateListResult {
  id: number;
  name: string;
  isApply: IsApplyEnum;
  questionnaireId: number;
  /** 是否开启申请须知 0 关闭 1 开启 */
  isApplyExplain: 0 | 1;
}

export interface ByIdApplyExplainResult {
  /** 附件地址 */
  applyAttachment: string;
  /** 富文本内容 */
  applyExplain: string;
  id: number;
}

/** 表单项结果 */
export interface customFormUserAnswerList {
  id: number;
  createBy: number;
  createTime: string;
  updateBy: number;
  updateTime: string;
  deleted: boolean;
  tenantId: number;
  appUserId: number;
  customFromId: number;
  formStageId: number;
  formGroupId: number;
  formItemId: number;
  answerIds: any;
  content: string;
  answerNo: string;
  status: number;
}

export interface MemberApplyResult {
  id: number;
  formStageId: number;
  proposer: string;
  applyType: number;
  auditStatus: AuditStatusEnum;
  customFormUserAnswerList: customFormUserAnswerList[];
  isFinish: IsFinishEnum;
  paymentStatus: PaymentStatusEnum;
  applyTemplateId: number;
  memberEndTime: string;
  levelName: string;
  leadingId: number;
  leadingMemberId: number;
  remark: string;
  companyId: number;
  companyName?: string;
}

export interface CustomFormGetStageListResult {
  customFromId: number;
  enabled: number;
  id: number;
  isAudit: number;
  name: string;
  sort: number;
}

export interface StageFormResult {
  id: number;
  name: string;
  formGroupMap: FormGroupMapItem[];
  formItemVoMap: FormItemVoMapItem;
}

export interface MemberTypeGetListItem {
  id: number | string;
  name: string;
  membershipFees?: number;
  allottedTime?: number;
  parentCode?: string
  code?: string
}

export interface MemberApplyFormAddData {
  applyTemplateId: number;
  formStageId: number;
  companyId?: number;
  customFormItem: {
    answerList: {
      formItemId: string | number;
      content: Array<string | number>;
      formStageId: string | number;
      formGroupId: string | number;
    }[];
  };
}

export interface MemberApplyFormAddResult {
  isFinish: IsFinishEnum;
  auditStatus: AuditStatusEnum;
  paymentStatus: PaymentStatusEnum;
}

export interface MemberInfoGetApplyResult {
  memberId: number;
  show: number;
  joinTime: string;
  memberEndTime: string;
  memberPostId: number;
  groupIds: number[];
  attacheUserId: number;
  attacheName: string;
  memberName: string;
  logo: string;
  applyType: ApplyTypeEnum;
  leadingId: number;
  contactPersonId: number;
  memberLevelId: number;
  auditStatus: AuditStatusEnum;
  companyId: number;
}

export interface MemberInfoResult extends MemberInfoGetApplyResult {
  customFormItemMap: FormItemVoMapItem;
  customFormUserAnswerList: customFormUserAnswerList[];
}

export interface CustomModuleTypeResult {
  id: number;
  name: string;
}

export interface ReportInfoResult {
  count: number;
  totalAward: string;
  expectPolicy: number;
  ascensionPolicy: number;
  /** 是否显示联系服务商 */
  isServiceProvider: boolean
  list3: ReportItem[];
  list4: ReportItem[];
  list5: ReportItem[];
}

export interface ReportItem {
  amount: number; //申报金额
  id: string; //id
  title: string; //项目名称
  dept: string; //受理部门
  deptCode: string;
  area: string;
  areaCode: string;
  time: string;
  support: string;
  industries: string;
  industriesCode: string;
  partition: string;
  partitionCode: string;
  condition: string;
  analysis: string;
  maxAward: number;
  updateDateTime: string;
  levelStar: string;
  year: number;
  endTime: string;
  startTime: string;
}

export interface PolicyDetailResult {
  id: string;
  title: string;
  dept: string;
  startTime: string;
  endTime: string;
  partition: string;
  industries: string;
  condition: string;
  support: string;
  materials: string;
  announcements: string;
}

export interface TotalAwardResult {
  totalAward: string;
  show: boolean;
}

export interface ServiceProviderResult {
  name: string;
  mobile: string;
  avatar: string;
  desc: string;
}

export interface PayWayData {
  // 微信支付
  weChatPayEnabled: boolean;
  // 二维码支付
  qrCodeCollectionEnabled: boolean;
  // 银行卡转账
  bankAccountCollectionEnabled: boolean;
  qrCode1?: string;
  qrCode2?: string;
  qrCodeName1?: string;
  qrCodeName2?: string;
  bankAccount?: string;
  bankDeposit?: string;
  collectionUnit?: string;
  remark?: string;
}

export interface PayInfoData {
  id: number;
  state: PaymentStatusEnum;
  auditStatus: PayAuditStatusEnum;
  levelName: string;
  money: number;
  allottedTime: number;
  payMoney: number;
  type: MemberOrderType;
  memberName?: string;
  endTime?: string;
  orderCode?: string;
  memberId?: number;
  remarks?: string;
}
